fix(responses): enforce tool choice in passthrough repair - #1667
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe change tracks routed custom tools converted by the Responses adapter. Passthrough restoration now uses that conversion metadata and tool policy, preserving native ChangesRouted custom-tool restoration
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change is localized to Responses tool-choice passthrough repair with focused regression coverage, and no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant buildRequest
participant rewriteRoutedCustomToolsForUpstream
participant ResponsesPassthrough
participant restoreRoutedCustomCallsInJson
buildRequest->>rewriteRoutedCustomToolsForUpstream: Rewrite routed custom tools
rewriteRoutedCustomToolsForUpstream-->>buildRequest: Return rewritten body and converted names
buildRequest-->>ResponsesPassthrough: Provide request metadata
ResponsesPassthrough->>restoreRoutedCustomCallsInJson: Restore eligible converted calls
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. |
|
Thanks for this — especially useful because it tightens the Responses passthrough boundary around client-executable custom tools. Restoring only tools the adapter actually lowered, while still respecting |
Summary
tool_choicestill authorizes it.apply_patch, forward-auth passthrough, and custom image tools replaced by hosted-provider policy instead of reinterpreting their upstream function calls.none,allowed_tools, named choices, misleading raw metadata, hosted-tool replacement, and the positive routed-custom path.Verification
devata1e5192b75edbf6dcacae51a30912fab93906f87; exact head:09086ed3a4c5819ab10a955563ac069104b74b5b.tests/responses-custom-tool-repair.test.ts— 19 pass;tests/openai-responses-passthrough.test.ts— 68 pass.bun x tsc --noEmitpassed on both runtimes.bun run privacy:scanandgit diff --checkpassed.tests/api-storage-policy-put-race.test.tswithout assertion failures, then the runtime exited with an internal assertion crash; that exact test passed 1/1 in a fresh isolated process.Checklist
tool_choicerestoration boundary.Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
apply_patch, remain unchanged.